# 1. 将所有数据存储在一个多行字符串中
data_string = """
-59.687500, 7.601562, 29.015625, 26.015625, -5.464844, 44.031250, 12.476562, -12.828125, 8.578125, 3.906250, 1.692383, -8.140625, 6.964844, -9.242188, 7.628906, -30.437500, -29.593750, 3.099609, 4.878906, 9.218750, -8.570312, 15.250000, -2.046875, 12.281250, -43.718750, -0.979492, 5.156250, -38.468750, -16.203125, -8.406250, -76.937500, 
-6.378906, 2.384766, -8.226562, -27.875000, 0.839355, 40.781250, 10.531250, 5.218750, 27.437500, 13.382812, -3.964844, -18.562500, -4.453125, 41.187500, -7.875000, 2.482422, -28.828125, -18.656250, -3.830078, -28.234375, -6.187500, 43.312500, -14.953125, 6.406250, 14.179688, 46.937500, 4.894531, 10.351562, -27.968750, 1.084961, 
-9.585938, -29.953125, 8.664062, 44.593750, 17.062500, 10.203125, 22.312500, 13.273438, -4.730469, 1.835938, -3.933594, 24.390625, 10.007812, -14.023438, 11.546875, 34.000000, 0.279297, 8.109375, 7.750000, 3.148438, -23.765625, 11.726562, 17.250000, -10.101562, 24.546875, -5.726562, -14.585938, 21.656250, -7.539062, -7.656250, 
25.281250, -3.519531, 6.898438, 26.531250, 38.937500, -7.605469, -2.064453, 32.031250, 13.570312, -24.218750, -9.117188, 36.093750, -20.281250, -13.820312, -16.453125, -26.796875, -38.937500, 17.859375, 3.580078, 23.937500, 18.031250, 4.472656, -10.148438, 13.179688, -20.031250, 2.906250, 31.812500, -12.453125, 6.710938, 2.824219, 
-41.437500, 63.656250, 16.359375, 22.046875, -2.015625, 12.390625, 7.984375
"""

# 2. 清理字符串并将其转换为一个数字列表
# - .replace('\n', ' ') 将所有换行符替换为空格，使数据变为单行
# - .split(',') 按逗号分割成一个字符串列表
# - s.strip() 去除每个数字字符串前后的多余空格
# - float() 将字符串转换为浮点数
# - if s.strip() 确保不会转换由尾部逗号等产生的空字符串
numbers = [float(s.strip()) for s in data_string.replace('\n', ' ').split(',') if s.strip()]

# 3. 计算总和并打印结果
total_sum = sum(numbers)
number_count = len(numbers)

# 打印验证信息和最终结果
print(f"成功解析出 {number_count} 个数字。")
print(f"这些数字的总和是: {total_sum}")

# 你也可以格式化输出，比如保留几位小数
print(f"格式化后的总和 (保留4位小数): {total_sum:.4f}")